﻿<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>jQueryHTML之removeAttr()</title>
        <script src="js/jquery-3.6.1.min.js"></script>
		<style>
		#test{
			font-style:italic;
			font-size:30px;
			font-weight:bold;
			background-color:lightblue;
		}
		div{
			width:200px;
			height:100px;
			border:1px solid gray;
			margin-bottom:10px;
		}
		</style>
    </head>
    <body>
        <h3>jQueryHTML之removeAttr()</h3>
        <hr>
        <div id="test">Hello jQuery</div>
        <button>清除元素的id属性</button>
        <script>
            $(document).ready(function() {
				//按钮的点击事件：清空<div>元素
                $("button").click(function() {
					$("div").removeAttr("id");				
                });
            });
        </script>
	</body>
</html>
